package grails.company

class Employee {

    static final String domain = 'employee'
    String firstName
    String lastName

    String emailAddress
    String accountName

    /**
     * Value added taxt identification number
     */
    long vatId
    String cardNumber = ''
    int salary = 0

    static constraints = {
        firstName blank: false
        lastName blank: false
        emailAddress blank: false, email: true
        accountName blank: false, size: 4..10, unique: true
        cardNumber creditCard: true
        salary min: 0
        vatId max:  1000000000000
    }

    static belongsTo = [project: Project]
}
